package com.jiawa.train.member.controller;

import com.jiawa.train.common.resp.PageResult;
import com.jiawa.train.common.resp.Result;
import com.jiawa.train.common.util.MemberContext;
import com.jiawa.train.member.req.TicketQueryReq;
import com.jiawa.train.member.service.TicketService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ticket")
@Slf4j
public class TicketController {

    @Resource
    private TicketService ticketService;
    @GetMapping("/page")
    public Result<PageResult> queryTicketList(TicketQueryReq  req) {
        req.setMemberId(MemberContext.getMember());
        log.info("查询开始，参数：{}", req.getMemberId());
       PageResult pageResult = ticketService.queryTicketList(req);
       return Result.success(pageResult);
    }

}

